<template>
  <div class="nav-header">
    <div class="icon">
      <el-icon size="30" @click="handleFoldClick"
        ><Fold v-if="!isFold" /><Expand v-else
      /></el-icon>
    </div>
    <div class="info">
      <NavBreadcrumb />
      <NavDropdown />
    </div>
  </div>
</template>

<script setup lang="ts">
import { Expand, Fold } from '@element-plus/icons-vue';
import NavDropdown from './components/nav-dropdown.vue';
import NavBreadcrumb from '@/base-ui/Breadcrumb/nav-breadcrumb.vue';
import { ref } from 'vue';
const emit = defineEmits(['clickFold']);
const isFold = ref(false);

const handleFoldClick = () => {
  isFold.value = !isFold.value;
  emit('clickFold', isFold.value);
};
</script>

<style scoped lang="less">
.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  .icon {
    cursor: pointer;
  }
  .info {
    width: 100%;
    margin: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}
</style>
